package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 了解Spring 容器的创建对象时的过程
 */
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                =new AnnotationConfigApplicationContext("demo7");
        System.out.println("Spring容器初始化完毕！");
        System.out.println("通过容器获取Person对象...");
        Person person=context.getBean(Person.class);
        System.out.println("3:调用对象Person对象的相关功能方法，进行使用...");
        person.play();
        context.close();
        System.out.println("Spring容器关闭了！通知当前对象");
    }
}
